import { Provide } from '@midwayjs/decorator';
import { getModelForClass } from '@typegoose/typegoose';
import { User } from '../entity/user';
@Provide()
export class userService {
  async getUser() {
    const UserModel = getModelForClass(User);
    const user = await UserModel.find();
    return user;
  }

  async createUser(body: any) {
    const UserModel = getModelForClass(User);
    const user = await UserModel.create(body);
    return user;
  }
}
